﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows.Controls.Primitives;
using System.IO;

namespace TakeNote
{
    /// <summary>
    /// Window4.xaml에 대한 상호 작용 논리
    /// </summary>
    public partial class Window1 : Window
    {
        int xx = 190;
        int yy;
        int xxx = 30;
        int count = 0;

        public Window1()
        {
            InitializeComponent();
            this.Topmost = true;
            this.ShowInTaskbar = true;

            double height = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height;
            double width1 = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;  //전체 가로 크기
            double width = height * 4 / 3; // 비율상 widh크기 구하기         
            this.Left = (width1 - width) / 2;
            this.Width = width;
            this.Height = height;
            this.Top = 0;
        }


        public void AddSms(string a, string b, string c)
        {
            
            System.Windows.Controls.RichTextBox newBtn = new System.Windows.Controls.RichTextBox();
            System.Windows.Controls.Button SaveButton = new System.Windows.Controls.Button();
         
           
            newBtn.Margin = new Thickness(xx, xxx, 0, 0);
            //newBtn.Top = xxx;
            //newBtn.Visible = true;
            newBtn.VerticalAlignment = VerticalAlignment.Top;
            newBtn.HorizontalAlignment = HorizontalAlignment.Left;
            
                

            ImageBrush berriesBrush = new ImageBrush();
            berriesBrush.ImageSource = new BitmapImage(new Uri(@"..\memo.png", UriKind.Relative));

            newBtn.Background = berriesBrush;
            newBtn.Width = 800;
            newBtn.Height = 800;
            newBtn.BorderBrush = null;
            FlowDocument aa = new FlowDocument();
            aa.Blocks.Add(new Paragraph(new Run("\n\n " + a + "\n " + b + "\n " + c)));
            newBtn.Document = aa;


            newBtn.FontSize = 60;


            this.grid1.Children.Add(newBtn);

            count = count + 1;

            //xx = xx + 400;
            //if ((count % 3) == 0)
          //  {
           //     xxx = xxx + 400;
          //      xx = 40;
            //}
            //xxx = xxx + 400;
        }

        private void grid1_PreviewMouseDown(object sender, MouseButtonEventArgs e)
        {
            string a = "01058582277";
            string b = " 호잇";
            string c = "2012/12/3";
            AddSms(a, b, c);
        }




    }

}
